import React, {Component, Fragment, lazy} from 'react';
import {Switch, Route, Redirect} from 'react-router-dom';

const Index = lazy(() => import('../components/ProductCategory/Index'));
const AddForm = lazy(() => import('../components/ProductCategory/ProductCategoryAddForm'));

class ProductCategory extends Component {
	render() {
		return (
			<Fragment>
				<Switch>
					<Route path="/product-category/index" exact component={Index}/>
					<Route path="/product-category/index/:id" component={Index}/>
					<Route path="/product-category/add" component={AddForm}/>
					<Redirect from="/product-category" to="/product-category/index"/>
				</Switch>
			</Fragment>
		);
	}
}

export default ProductCategory;